import request from '@/utils/request'

class IdaaS {
  constructor() {
  }
  //获取岗位列表
  async getDepts() {
    let url = `/idaas/api/departments?tree=true`
    let res = await request.get(url)
    return res
  }
  //获取用户列表
  async getUsers(deptId) {
    let url = `/idaas/api/users?deptId=${deptId}`
    let res = await request.get(url)
    return res
  }
  //获取子应用
  async getSubApps() {
    let url = `/idaas/api/subapps`
    let res = await request.get(url)
    return res
  }
  //获取菜单
  async getMenus() {
    let url = `/idaas/api/menus`
    let res = await request.get(url)
    return res
  }
  //获取应用详情
  async getApp() {
    let url = `/idaas/api/apps/me`
    let res = await request.get(url)
    return res
  }
  //获取个人信息
  async userinfo(){
    let url = `/idaas/api/me`
    let res = await request.get(url)
    return res
  }

}

let idaas = new IdaaS()
export default idaas